package com.rm.zeyou.mapper;

import com.rm.zeyou.entity.UserItemOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rm.zeyou.vo.response.SelectUserItemOrderDetailResponseVo;
import com.rm.zeyou.vo.response.SelectUserItemOrderListResponseVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 用户订单表 Mapper 接口
 * </p>
 *
 * @author YanYang
 * @since 2025-03-12 15:55:09
 */
@Mapper
public interface UserItemOrderMapper extends BaseMapper<UserItemOrder> {

    List<SelectUserItemOrderListResponseVo> selectListByType(@Param("userId") Long userId, @Param("type") Integer type);

    SelectUserItemOrderDetailResponseVo selectOrderDetail(@Param("userId")Long userId,@Param("orderNo") String orderNo);

    Integer updateOrderStatus(@Param("orderNo") String orderNo, @Param("status") Integer status);
    Integer updateOrder(@Param("orderNo") String orderNo, @Param("status") Integer status);

    UserItemOrder selectOneByOrderNo(@Param("orderNo") String orderNo);

    @Update("update t_user_item_order set zfb_pay_param = #{pay} where order_no = #{orderNo}")
    Integer insertZfbInfo(@Param("orderNo") String orderNo, @Param("pay") String pay);
}
